package net.colah.k1.application.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import net.colah.k1.core.Order;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.openkoala.koala.springmvc.JsonDateSerializer;
import org.springframework.format.annotation.DateTimeFormat;


public class OrderDTO implements Serializable {

	private Long id;

		
	private String meno;
	
		
	private String desc;
	
		
	private Order.State state;
	
		
	private BigDecimal freight;
	
		
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date finishDate;
	
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date finishDateEnd;
		
	private String code;
	
		
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date createDate;
	
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date createDateEnd;
		
	private Order.Type type;
	
		
	private BigDecimal sumPrice;
	
			
		

	public void setMeno(String meno) { 
		this.meno = meno;
	}

	public String getMeno() {
		return this.meno;
	}
	
			
		

	public void setDesc(String desc) { 
		this.desc = desc;
	}

	public String getDesc() {
		return this.desc;
	}
	
			
		

	public void setState(Order.State state) { 
		this.state = state;
	}

	public Order.State getState() {
		return this.state;
	}
	
			
		

	public void setFreight(BigDecimal freight) { 
		this.freight = freight;
	}

	public BigDecimal getFreight() {
		return this.freight;
	}
	
			
		

	public void setFinishDate(Date finishDate) { 
		this.finishDate = finishDate;
	}

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getFinishDate() {
		return this.finishDate;
	}
	
	public void setFinishDateEnd(Date finishDateEnd) { 
		this.finishDateEnd = finishDateEnd;
	}

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getFinishDateEnd() {
		return this.finishDateEnd;
	}
			
		

	public void setCode(String code) { 
		this.code = code;
	}

	public String getCode() {
		return this.code;
	}
	
			
		

	public void setCreateDate(Date createDate) { 
		this.createDate = createDate;
	}

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getCreateDate() {
		return this.createDate;
	}
	
	public void setCreateDateEnd(Date createDateEnd) { 
		this.createDateEnd = createDateEnd;
	}

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getCreateDateEnd() {
		return this.createDateEnd;
	}
			
		

	public void setType(Order.Type type) { 
		this.type = type;
	}

	public Order.Type getType() {
		return this.type;
	}
	
			
		

	public void setSumPrice(BigDecimal sumPrice) { 
		this.sumPrice = sumPrice;
	}

	public BigDecimal getSumPrice() {
		return this.sumPrice;
	}
	

	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getId() {
		return id;
	}

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderDTO other = (OrderDTO) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
}